//
//  HomeBannerInfo.m
//  HWZB
//
//  Created by 许成雄 on 2017/4/20.
//  Copyright © 2017年 wonders. All rights reserved.
//

#import "HomeBannerInfo.h"

@implementation HomeBannerInfo

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
    return @{
             @"bannerId" : @"headId",
             @"imageUrl" : @"picUrl",
             @"order" : @"order",
             @"showOrder" : @"showOrder",
             @"type" : @"type",
             @"url" : @"url",
             @"wxmpUrl" : @"wxmpUrl",
             @"title" : @"title",
             @"desc" : @"desc"
             };
}

+ (NSValueTransformer *)bannerIdJSONTransformer {
    return [MTLValueTransformer transformerWithBlock:^id(id value) {
        if([value isKindOfClass:[NSNumber class]]) {
            return [value stringValue];
        } else {
            return (NSString *)value;
        }
    }];
}

+ (NSValueTransformer *)showOrderJSONTransformer {
    return [MTLValueTransformer transformerWithBlock:^id(id value) {
        if([value isKindOfClass:[NSNumber class]]) {
            return [value stringValue];
        } else {
            return (NSString *)value;
        }
    }];
}

+ (NSValueTransformer *)typeJSONTransformer {
    return [MTLValueTransformer transformerWithBlock:^id(id value) {
        if([value isKindOfClass:[NSNumber class]]) {
            return [value stringValue];
        } else {
            return (NSString *)value;
        }
    }];
}

@end
